﻿@using PagedList.Mvc
@model PagedList.IPagedList<Model.INVENTORY>
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Zarządzaj Inwentaryzacjami</h2>

<p>
    <div>
        @Html.ActionLink("Dodaj nową inwentaryzację", "Create", new {}, new { @class = "btn btn-primary" })
    </div>
</p>
<div class="box-body">
    <table id="grid" class="table table-bordered table-striped">
        <thead>
            <tr>
                <th>
                    Nazwa:
                </th>
                <th>
                    Zakład:
                </th>
                <th>
                    Data rozpoczęcia:
                </th>
                <th>
                    Data zakończenia:
                </th>
            </tr>
        </thead>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.NAME)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PLANT)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PERIOD_FROM)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PERIOD_TO)
                </td>
                <td>
                    @Html.ActionLink("Edytuj", "Edit", new {id =@item.INVENTORYID}, new { @class = "btn btn-primary" })
                </td>
            </tr>
        }

    </table>Strona @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) z @Model.PageCount

    @Html.PagedListPager(Model, page => Url.Action("Index",
    new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }))

</div>
<div id="invCreateWr"></div>